<?php
/**
 * Created by PhpStorm.
 * User: C。
 * Date: 2019/8/13
 * Time: 9:04
 */
namespace app\home\controller;

use app\common\model\FreeAnimal as FreeAnimalModel;

/**
 * 放生控制器
 * Class Freeanimal
 * @package app\home\controller
 */
class Freeanimal extends Base
{
    /**
     * [add  添加]
     * @param
     * @return json
     * @author [C。]
     */
    public function add()
    {
        $model = new FreeAnimalModel;
        $param = input('param.');
        $user = $this->user;
        try{
            $param['mid'] = $user['id'];
            $model->addData($param);
            add_quality($user['id'],10,$user['quality'],2);
        }catch(\Exception $e){
            systembug($e->getMessage(),2,$this->url);
            return admin_json(-1, '添加失败'.$e->getMessage());
        }
        return admin_json(1,'添加成功');
    }
}